<html>
<head><meta charset="utf-8"><title>constants, canonicalization, and normalization oh my! · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html">constants, canonicalization, and normalization oh my!</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="165086106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165086106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165086106">(May 07 2019 at 16:14)</a>:</h4>
<p>So I have been looking into what exactly goes wrong when we try to have constant evaluation done "correctly". After discussing with <span class="user-mention" data-user-id="119009">@eddyb</span>, I modified the "parent" of inline constants so that they inherit from their environment. I immediately started hitting problems with <a href="https://github.com/rust-lang/rust/blob/c6ac57564852cb6e2d0db60f7b46d9eb98d4b449/src/librustc/traits/project.rs#L404-L419" target="_blank" title="https://github.com/rust-lang/rust/blob/c6ac57564852cb6e2d0db60f7b46d9eb98d4b449/src/librustc/traits/project.rs#L404-L419">this code</a> in <code>project.rs</code>. Specifically it fails on this line:</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">substs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tcx</span><span class="p">.</span><span class="n">lift_to_global</span><span class="p">(</span><span class="o">&amp;</span><span class="n">substs</span><span class="p">).</span><span class="n">unwrap</span><span class="p">();</span><span class="w"></span>
</pre></div>


<p>because the lift fails. I've then been skimming <span class="user-mention" data-user-id="124288">@oli</span>'s PR <a href="https://github.com/rust-lang/rust/issues/59369" target="_blank" title="https://github.com/rust-lang/rust/issues/59369">#59369</a>, which I don't really follow in its entirety, but I see talks about canonicalization.</p>
<p>I wanted to try and help out in figuring out what the right thing to do is here. =)</p>



<a name="165087527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165087527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165087527">(May 07 2019 at 16:30)</a>:</h4>
<p>Presumably constant evaluation doesn't really care about lifetimes</p>



<a name="165087573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165087573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165087573">(May 07 2019 at 16:31)</a>:</h4>
<p>But what would happen if it encountered an "inference variable" -- is it prepared for that? I guess this could happen if you had generic constants, at least in some circumstances.</p>



<a name="165087607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165087607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165087607">(May 07 2019 at 16:31)</a>:</h4>
<p>(This reminds me that I also wanted to talk over the const generics strategy with <span class="user-mention" data-user-id="121053">@varkor</span>; I guess I don't have a tight mental model for what the "distinct pieces" are here)</p>



<a name="165089020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165089020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165089020">(May 07 2019 at 16:48)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I was hoping we could give miri the canonical form</p>



<a name="165089025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165089025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165089025">(May 07 2019 at 16:48)</a>:</h4>
<p><em>not</em> run miri inside an inference context</p>



<a name="165089041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165089041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165089041">(May 07 2019 at 16:48)</a>:</h4>
<p>but as if the inference variables were parameters in scope</p>



<a name="165089078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165089078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165089078">(May 07 2019 at 16:49)</a>:</h4>
<p>it can't advance inference, but it can "polymorphically evaluate" in some cases</p>



<a name="165089749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165089749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165089749">(May 07 2019 at 16:57)</a>:</h4>
<blockquote>
<p>I was hoping we could give miri the canonical form</p>
</blockquote>
<p>this is exactly what I had in mind, <span class="user-mention" data-user-id="119009">@eddyb</span></p>



<a name="165089814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165089814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165089814">(May 07 2019 at 16:58)</a>:</h4>
<p>I mean this should basically "just work", presuming miri can cope with the presence of canonical vars</p>



<a name="165089950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165089950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165089950">(May 07 2019 at 17:00)</a>:</h4>
<p>miri doesn't <em>really</em> look at types ;)</p>



<a name="165089970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165089970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165089970">(May 07 2019 at 17:00)</a>:</h4>
<p>with minor exceptions</p>



<a name="165090035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090035">(May 07 2019 at 17:01)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> it's likely that the only thing you need to do is move whatever category of type in question to this match arm: <a href="https://github.com/rust-lang/rust/blob/f5371a5ac7a9ef4446d46e7c8a2523e56f7a7900/src/librustc/ty/layout.rs#L1229" target="_blank" title="https://github.com/rust-lang/rust/blob/f5371a5ac7a9ef4446d46e7c8a2523e56f7a7900/src/librustc/ty/layout.rs#L1229">https://github.com/rust-lang/rust/blob/f5371a5ac7a9ef4446d46e7c8a2523e56f7a7900/src/librustc/ty/layout.rs#L1229</a></p>



<a name="165090075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090075">(May 07 2019 at 17:02)</a>:</h4>
<p>OK. I am right now doing a quick hack to try and unblock my investigations -- namely, erasing the regions before invoking <code>lift</code></p>



<a name="165090123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090123">(May 07 2019 at 17:02)</a>:</h4>
<p>but I could take a look at introducing the canonicalizations, or point <span class="user-mention" data-user-id="124288">@oli</span> in the right direction</p>



<a name="165090129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090129">(May 07 2019 at 17:02)</a>:</h4>
<p>oh, regions, lol</p>



<a name="165090149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090149">(May 07 2019 at 17:02)</a>:</h4>
<p>we should always erase regions and recover them in the type</p>



<a name="165090152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090152">(May 07 2019 at 17:02)</a>:</h4>
<p>Something still feels "funny" to me about how we are doing normalization here</p>



<a name="165090155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090155">(May 07 2019 at 17:02)</a>:</h4>
<p>did I not do that already?</p>



<a name="165090209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090209">(May 07 2019 at 17:03)</a>:</h4>
<p>miri shouldn't see unerased regions, they should only exist on the "user side" of const-eval, not inside the query</p>



<a name="165090214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090214">(May 07 2019 at 17:03)</a>:</h4>
<p>You did not, but that quick hack doesn't get me that far</p>



<a name="165090227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090227">(May 07 2019 at 17:03)</a>:</h4>
<p>error: internal compiler error: src/librustc/traits/project.rs:415: failed to lift [ReErased, ReErased, _, _] to global</p>



<a name="165090229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090229">(May 07 2019 at 17:03)</a>:</h4>
<p>but I may have been overly cautious</p>



<a name="165090285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090285">(May 07 2019 at 17:04)</a>:</h4>
<p>when I was talking about canonicalization, I've been referring to const/type inference variables all along, not lifetimes</p>



<a name="165090299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090299">(May 07 2019 at 17:04)</a>:</h4>
<p>yes, that's what you need to canonicalize</p>



<a name="165090434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090434">(May 07 2019 at 17:06)</a>:</h4>
<p>btw, having non-<code>ty::Param</code> "type variables" in codegen, which <code>ty::layout</code> treats the same as type parameters, is the way I think we should do both <code>DispatchFromDyn</code> (although there you arguably can have a <code>ty::Param</code>?) and "polymorphization"</p>



<a name="165090483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090483">(May 07 2019 at 17:07)</a>:</h4>
<p>re: polymorphization, I sort of forgot that <span class="user-mention" data-user-id="116107">@davidtwco</span> and I were doing investigations there, trying to get a figure on what kind of improvements we could expect. Our prelim results were "not much" but we didn't really get that far.</p>



<a name="165090488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090488">(May 07 2019 at 17:07)</a>:</h4>
<p>anyway, that's off topic :)</p>



<a name="165090495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090495">(May 07 2019 at 17:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> btw, you need to be very careful if you've erased lifetimes</p>



<a name="165090499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090499">(May 07 2019 at 17:07)</a>:</h4>
<p>ugh, I've been meaning to get back to that.</p>



<a name="165090554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165090554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165090554">(May 07 2019 at 17:08)</a>:</h4>
<p>to make sure there are no lifetimes in the value itself, and to use the old type</p>



<a name="165091157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165091157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165091157">(May 07 2019 at 17:16)</a>:</h4>
<p>so none of the erasure leaks back into whatever wanted to normalize the const</p>



<a name="165092296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/constants%2C%20canonicalization%2C%20and%20normalization%20oh%20my%21/near/165092296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/constants.2C.20canonicalization.2C.20and.20normalization.20oh.20my!.html#165092296">(May 07 2019 at 17:29)</a>:</h4>
<p>yeah -- so -- actually I think there is a simpler hack to get me past my <em>immediate</em> problems, but it may fail down the line</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>